import {Post, Get} from "../server";

export function list(data= []) {
    return Get("/api1/robot/list", data);
}


export function getStatus(data= []) {
    return Get("/api1/robot/getStatus", data);
}


export function getById(data) {
    return Post("/api1/robot/getById", data);
}

export function remove(data) {
    return Post("/api1/robot/delete", data);
}

export function update(data) {
    return Post("/api1/robot/update", data);
}

export function getInstallUrl(robot_id) {
    return Post("/api1/robot/getInstallUrl", {robot_id});
}

export function setJsStatus(robot_id, status) {
    return Post("/api1/robot/setJsStatus", {robot_id, status});
}

export function setShareStatus(robot_id, status) {
    return Post("/api1/robot/setShareStatus", {robot_id, status});
}

export function getShareUrl(robot_id) {
    return Post("/api1/robot/getShareUrl", {robot_id});
}

export function setSharePassword(robot_id, password) {
    return Post("/api1/robot/setSharePassword", {robot_id, password});
}

export const robot = {
    list,
    getById,
    remove,
    update,
    getStatus,
    getInstallUrl,
    setJsStatus,
    setShareStatus,
    getShareUrl,
    setSharePassword,

};
